package ru.passivemoney.subscribers;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import ru.passivemoney.strategy.AStrategy;
import ru.passivemoney.strategy.Prognosis;

import com.dukascopy.api.IBar;
import com.dukascopy.api.Instrument;
import com.dukascopy.api.JFException;
import com.dukascopy.api.Period;

/**
 * @see ru.passivemoney.subscribers.ASubscriber
 * @author artem
 *
 */
public class DummySubscriber extends ASubscriber {
	
	private static final Logger logger = LoggerFactory.getLogger(DummySubscriber.class);
	
	public DummySubscriber(Instrument instrument, AStrategy strategy) {
		super(instrument, strategy);
	}

	/**
	 * @see ru.passivemoney.subscribers.ASubscriber#reactOnBar(Period, IBar, IBar)
	 */
	public void reactOnBar(Period period, IBar askBar, IBar bidBar) throws JFException{
		logger.info("askBar open - {}; bidBarOpen - {}", askBar.getOpen(), bidBar.getOpen());
		Prognosis prognosis = strategy.processBar(instrument, period, askBar, bidBar);
		// на основе прогноза принимаем решение об открытии ордера
	}

}
